package file;


import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入文件名");
        while (true){
            String fileName = scan.nextLine();
            File file = new File(fileName);
            if(file.exists()){
                System.out.println("重复,重新输入");
            }else{
                file.createNewFile();
                System.out.println("成功");
                break;
            }
        }
    }
}
